<?php
	
	function executeSqlScript($scriptPathAndName)
	{
		require_once("\private\mysqli_connect.php");
		$sqlFile = file("$scriptPathAndName");
		$query = "";
		foreach($sqlFile as $line):
			$query = $query . $line;
		endforeach;
		$query = $query . "\n";
		echo preg_replace("/\n/", "<br/>", $query) . "<br />";
		$query = explode(";", $query);
		foreach($query as $command):
			echo $command;
			$result = $db->query($command . ";");
			if(empty($db->error)):
				echo " (success)";
			else:
				echo "Invalid: " . preg_replace("/\n/", "<br/>",$db->error) . "</br>";
			endif;
			echo "<br/><br/>";
		endforeach;
	}

?>